<!--各厂产能分析-->
<div style="height:15px;"></div>
<table class="layui-table gccnfx_table">
    <thead>
    <tr class="layui-bg-green">
        <th width="10%"></th>
        <?php foreach($factoryKV as $k=>$v){ if ($k==0) continue;?>
        <th width="<?php echo 90/count($factoryKV)?>%"><?php echo $v;?></th>
        <?php }?>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>7日平均日产能</td>
        <?php foreach($factoryKV as $k=>$v) { if($k==0) continue;?>
        <td id="days_avg_7_<?php echo $k;?>"></td>
        <?php }?>
    </tr>
    <tr>
        <td>14日平均日产能</td>
        <?php foreach($factoryKV as $k=>$v) { if($k==0) continue;?>
        <td id="days_avg_14_<?php echo $k;?>"></td>
        <?php }?>
    </tr>
    <tr>
        <td>21日平均日产能</td>
        <?php foreach($factoryKV as $k=>$v) { if($k==0) continue;?>
        <td id="days_avg_21_<?php echo $k;?>"></td>
        <?php }?>
    </tr>
    <tr>
        <td>在途产能</td>
        <?php foreach($factoryKV as $k=>$v) { if($k==0) continue;?>
        <td id="all_<?php echo $k;?>"></td>
        <?php }?>
    </tr>
    <tr>
        <td>压力系数(7日-14日-21日)</td>
        <?php foreach($factoryKV as $k=>$v) { if($k==0) continue;?>
        <td id="yali_<?php echo $k;?>"></td>
        <?php }?>
    </tr>
    </tbody>
</table>
<script>
    var getDeliverNotFinishAll_all_factory_data={};
    layui.use(['jquery', 'layer'], function() {
        var $ = layui.jquery;
        var layer = layui.layer;

        //在途产能--信息查询
        window.getDeliverNotFinishAll_all_factory = function() {
            $.ajax({
                type: "POST",
                url: "{:url('getDeliverNotFinishAll_all_factory')}",
                data: "factory_id="+factoryId+"&from="+from,
                dataType: "json",
                success: function(res){
                    getDeliverNotFinishAll_all_factory_data=res;
                    $.each( res.data, function(i, n){
                        var temp7=n.days_avg_7.avg.all;
                        $("#days_avg_7_"+i).html(temp7.jianshu+"件/"+temp7.num+"单<br/>"+temp7.money+"元");
                        var temp14=n.days_avg_14.avg.all;
                        $("#days_avg_14_"+i).html(temp14.jianshu+"件/"+temp14.num+"单<br/>"+temp14.money+"元");
                        var temp21=n.days_avg_21.avg.all;
                        $("#days_avg_21_"+i).html(temp21.jianshu+"件/"+temp21.num+"单<br/>"+temp21.money+"元");
                        var temp_all=n.all.all;
                        $("#all_"+i).html(temp_all.jianshu+"件/"+temp_all.num+"单/首单:"+temp_all.num_is_new+"个<br/>"+temp_all.money+"元");
                        var temp7=n.days_avg_7.avg.all;
                        $("#days_avg_7_"+i).html(temp7.jianshu+"件/"+temp7.num+"单<br/>"+temp7.money+"元");
                        //压力系数
                        var data7=n.yali[7];
                        var data14=n.yali[14];
                        var data21=n.yali[21];
                        var html=data7.all.jianshu+'-'+data14.all.jianshu+'-'+data21.all.jianshu+'<br>' +
                            data7.all.money+'-'+data14.all.money+'-'+data21.all.money+'' ;
                        $("#yali_"+i).html(html);
                    });
                }
            });
        }
        getDeliverNotFinishAll_all_factory();
    });
</script>